<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../../../dialog.header.jsp"%>
<style type="text/css">
#dialogAreaTreeDiv {
	height: 220px;
	width: 98%;
	border: 1px solid #CCCCCC;
	overflow:auto;
}
</style>
<script type="text/javascript">
var _tree;
var _curr_node;

function _refresh() {
	_curr_node = null;
	_tree.jstree("refresh","-1");
}

function _beforeConfirm(callback) {
	if (_curr_node == null) {
		$.alert("请选择城市！");
		return false;
	}
	var data = _curr_node.rslt.obj;
	if(data.data("type") != "city"){
		$.alert("请选择城市！");
		return false;
	}
	callback(data);
	return true;
}

$("#dialogAreaTreeDiv").ready(function() {
	_curr_node = null;
	_tree = $.readonlyTree("#dialogAreaTreeDiv",ctx+"/biz/dict/area/tree.json");
	_tree.bind("select_node.jstree",function(e,data) {
		_curr_node = data;
	});
});

</script>

<div id="dialogAreaTreeDiv">
</div>
